﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class enum_flags : Form
    {
        public enum_flags()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            EType t = EType.支付成功 | EType.订单完成;
            EType tx = (EType)9;
            var h = (t & EType.支付成功) == EType.支付成功;

            var l = new List<EType>() { EType.None,EType.订单撤销,EType.订单初始};
            h=l.Contains(EType.订单初始);
        }
    }
    [Flags]
    public enum EType
    {
        None = 0,
        支付成功 = 1,
        订单初始 = 2,
        订单撤销 = 4,
        订单完成 = 8,
    }
}
